'use strict';



import React, { Component } from 'react';

import {
	View,
	Image,
	ImageBackground,
	Dimensions,
	TouchableWithoutFeedback,
	StyleSheet,
	Text,
	TouchableOpacity,
	TextInput,
	ScrollView,
	TouchableHighlight,
	TouchableNativeFeedback,
	Switch,
} from 'react-native';

import ToastUtil from 'shequnsiweiapp/src/core/utils/ToastUtil.js';
var { Loading, EasyLoading } = require('react-native-easy-loading');

import DatePicker from 'react-native-datepicker'


import CameraButton from 'shequnsiweiapp/src/core/component/CameraButton.js';
import Color from 'shequnsiweiapp/src/core/constant/Color.js';






let winWidth = Dimensions.get('window').width;//屏幕宽度

let winHeight = Dimensions.get('window').height;//屏幕高度




let headImgEmpty = require('shequnsiweiapp/src/img/headImg_empty.png');
import Http from 'shequnsiweiapp/src/core/utils/Http.js';
import ToolbarSetProperty from './ToolbarSetProperty.js';





let instance;

let navParams;
class SetTextInput extends React.Component {
	// 构造
	constructor(props) {
		super(props);



		navParams = this.props.navigation.state.params;
		

		this.state = {

			 value:navParams.oldValue


		}
		console.log(this);

		instance = this;



	}










	componentWillMount() {


	}



	componentDidMount() {




	}







	render() {
		return (

			<View>
				<ToolbarSetProperty
					navigation={this.props.navigation}
					text={navParams.title}
					oldValue={navParams.oldValue} 
					newValue={this.state.value}
					complete={navParams.callback}
                       
					
					/>


				<ScrollView style={styles.body}>


					<Loading />

					<View style={styles.input_view}>
					<TextInput
					maxLength={100}
					style={{width:winWidth-10}}
					placeholder={'请输入'}
					placeholderTextColor={'#CCC'}
					underlineColorAndroid="transparent"
					defaultValue={navParams.oldValue}
					blurOnSubmit={true}
					onChangeText={(text) => { this.setState({ value: text }) }}
				/>
					</View>










				</ScrollView>
			</View>




		)
		//}




	}

}




const styles = StyleSheet.create({
	body: {
		backgroundColor: Color.VIEW_BGCOLOR,
		height: winHeight,
	},

	zhushi_view: {
		marginLeft: 15, marginRight: 15, marginTop: 15, marginBottom: 0,
		flexDirection: "row", justifyContent: "center",
	},
	zhushi_text: {
		color: Color.TEXT_GREY,
		fontSize: 14,

	},

	input_view: {
		marginLeft: 0, marginRight: 0, marginTop: 0, marginBottom: 0, flexDirection: "row",
		justifyContent: "center", backgroundColor: "#ffffff", borderBottomWidth: 1, borderColor: Color.TEXTINPUT_LINE, padding: 8
	},

	input_label_view: {
		flex: 1, flexDirection: "row",
	},

	input_label_text: {
		alignSelf: "center",
	},
	input_value_view: {
		flex: 3, flexDirection: "row", justifyContent: "flex-end",
		alignSelf: "center",


	},

	btn: {
		backgroundColor: Color.BTN_BGCOLOR,
		padding: 10,
		margin: 15,
		marginBottom: 0,
		borderRadius: 5,
	}
	,
	btn_text: {
		alignSelf: 'center', fontSize: 15, color: Color.BTN_TEXT
	}


});

module.exports = SetTextInput;